//package com.xej.taco_cloud.service.impl;
//
//import com.xej.taco_cloud.pojo.User;
//import com.xej.taco_cloud.security.UserRepository;
//import com.xej.taco_cloud.service.UserDetailsService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
//import org.springframework.stereotype.Service;
//
//@Service
//public class UserRepositoryUserDetailsService implements UserDetailsService {
//
//    private UserRepository userRepository;
//
//    @Autowired
//    public UserRepositoryUserDetailsService(UserRepository userRepository) {
//        this.userRepository = userRepository;
//    }
//
//    @Override
//    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
//        User user = userRepository.findByUserName(username);
//        if (user!=null){
//            return user;
//        }
//        throw new UsernameNotFoundException("user not found");
//    }
//}
